import { synchronyDatalake } from '@/services/api/api-assess-week-culture-synchrony';
import { PageContainer } from '@ant-design/pro-components';
import { Button, message } from 'antd';
import 'dayjs/locale/zh-cn';
import React from 'react';
import { useAccess } from 'umi';
import TableOverview from './analysis/TableOverview';

export default (): React.ReactNode => {
  const access = useAccess();

  return (
    <PageContainer
      header={{
        title: '质效考核辅助',
        breadcrumb: {
          items: [],
        },
        extra: [
          <Button
            hidden={!access.unIframShowAdmin}
            key="dataHub"
            type="primary"
            onClick={async () => {
              const response = await synchronyDatalake();
              if (response.code === 0) {
                message.success('同步成功');
              }
            }}
          >
            同步数据
          </Button>,
        ],
      }}
      // extra={
      //   <Alert
      //     message="2024年第一季度全媒体质效考核任务入口已经开启，请各位用户按要求填写"
      //     type="success"
      //     showIcon
      //   />
      // }
    >
      <TableOverview />
    </PageContainer>
  );
};
